package top.jandmla.excel.configParam;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import top.jandmla.excel.pojo.User;

import java.io.File;

@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class UserBuilder {
    private String dbType = "postgis";
    private String dbHost = "localhost";
    private Integer dbPort = 5432;
    private String dataBase = "mydb";
    private String username = "root";
    private String password = "root";
    private File file;


    public UserBuilder setDbType(String dbType) {
        this.dbType = dbType;
        return this;
    }

    public UserBuilder setDbHost(String dbHost) {
        this.dbHost = dbHost;
        return this;
    }

    public UserBuilder setDbPort(Integer dbPort) {
        this.dbPort = dbPort;
        return this;
    }

    public UserBuilder setDataBase(String dataBase) {
        this.dataBase = dataBase;
        return this;
    }

    public UserBuilder setUsername(String username) {
        this.username = username;
        return this;
    }

    public UserBuilder setPassword(String password) {
        this.password = password;
        return this;
    }

    public UserBuilder setFile(File file) {
        this.file = file;
        return this;
    }

    public User builder() {
        return new User(this.getDbType(), this.getDbHost(),
                this.getDbPort(), this.getDataBase(),
                this.getUsername(), this.getPassword(), this.getFile());
    }
}
